Standby control method and system, terminal, and relay device

ABSTRACT

A standby control method includes sending first notification information to a relay device through a first communication link by a terminal before entering a standby mode. The relay device serves as a proxy for the terminal based on the first notification information, and the relay device sends a first keep-alive packet to a cloud server to inform the cloud server that the terminal is online. The terminal then disables the first communication link and a main CPU. The relay device sends a second keep-alive packet to the terminal through a second communication link, and the terminal sends acknowledgement information of the second keep-alive packet to the relay device through the second communication link to inform the relay device that the terminal is online, where a communication rate of the second communication link is lower than a communication rate of the first communication link.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2019/076930, filed on Mar. 5, 2019, which claims priority toChinese Patent Application No. 201810553415.X, filed on May 31, 2018.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the communications field, and in particular,to a standby control method and system, a terminal, and a relay device.

BACKGROUND

In recent years, an Internet of things technology has developed rapidly,and has a promising prospect in such industries as intelligentmanufacturing, smart home, the Internet of vehicles, logistics,transportation, and meter reading. Many Internet of things terminals aredevices with built-in batteries. A relatively long working time needs tobe maintained. In addition, to meet a service requirement, the terminalneeds to quickly communicate with a cloud network in real time. Thisprovides a relatively high technical requirement for the Internet ofthing terminal to meet low power consumption and quick networking.

The Internet of things terminal usually includes a main control moduleand a communications module. In the prior art, when the Internet ofthings terminal works normally, the main control module performs dataprocessing, and the communications module obtains data from a routerthrough a high-speed communication link and sends the data to the maincontrol module, or sends data obtained through processing by the maincontrol module to a router through a high-speed communication link.

When the Internet of things terminal is in a standby mode, the maincontrol module is powered off. However, to keep the Internet of thingsterminal capable of being quickly networked and being remotely woken up,the communications module periodically transmits a keep-alive packet tothe router through the high-speed communication link, to keep aheartbeat connection.

However, power consumption of transmitting the keep-alive packet throughthe high-speed communication link by the communications module isrelatively high. Therefore, power consumption of the Internet of thingsterminal in the standby mode is relatively high.

SUMMARY

This application provides a standby control method, to reduce powerconsumption of a terminal in a standby mode.

A first aspect of the embodiments of this application provides a standbycontrol system. The system includes a terminal and a relay device. Theterminal is configured to: before entering a standby mode, send firstnotification information to the relay device through a firstcommunication link. The relay device is configured to serve, based onthe first notification information, as a proxy for the terminal to senda first keep-alive packet to a cloud server, so that the cloud serverconfirms that the terminal is online. The terminal is further configuredto disable the first communication link and a main control centralprocessing unit CPU. The relay device is further configured to send asecond keep-alive packet to the terminal through a second communicationlink. The terminal is further configured to send acknowledgementinformation of the second keep-alive packet to the relay device throughthe second communication link, so that the relay device confirms thatthe terminal is online. A communication rate of the second communicationlink is lower than a communication rate of the first communication link.

According to the standby control system provided in the embodiments ofthis application, the terminal keeps a connection to the cloud by usingthe relay device, and business service data is transmitted between theterminal and the relay device through the first communication link. Whenthe terminal enters the standby mode, the terminal disables the firstcommunication link, and a second communications module of the terminalperforms a heartbeat keep-alive operation with a second communicationsmodule of the relay device by using the second communication link. Thecommunication rate of the second communication link is lower than thecommunication rate of the first communication link. In comparison with aheartbeat keep-alive operation performed by using the firstcommunication link when the terminal is in the standby mode, in theembodiments of this application, power consumption of the terminal inthe standby mode is reduced.

Based on the first aspect of the embodiments of this application, in afirst implementation of the first aspect of the embodiments of thisapplication, the terminal is further configured to receive, through thesecond communication link, a wakeup packet sent by the relay device; andthe terminal is further configured to enable the main control CPU andthe first communication link based on the wakeup packet.

According to the standby control system provided in the embodiments ofthis application, when the terminal is in the standby mode, the relaydevice sends the wakeup packet to the terminal through the secondcommunication link, to wake up the terminal, so that the terminalrestores a normal service mode from the standby mode. Therefore, aspecific manner of waking up the terminal is provided, so that thesolution is more feasible.

Based on the first aspect or the first implementation of the firstaspect of the embodiments of this application, in a secondimplementation of the first aspect of the embodiments of thisapplication, the disabling the first communication link includesdisabling a radio frequency (RF) module used for high-speed datatransmission.

According to the standby control system provided in the embodiments ofthis application, disabling the first communication link may bedisabling the RF module used for high-speed data transmission, andenabling the first communication link may also be enabling the RF moduleused for high-speed data transmission. Therefore, a method for enablingor disabling the first communication link is provided, so that thesolution is more feasible.

Based on the first implementation of the first aspect of the embodimentsof this application or the second implementation of the first aspect ofthe embodiments of this application, in a third implementation of thefirst aspect of the embodiments of this application, the wakeup packetincludes a channel parameter of the first communication link; and theterminal is specifically configured to enable the first communicationlink based on the channel parameter, to perform service communicationwith the relay device through the first communication link.

According to the standby control system provided in the embodiments ofthis application, when the terminal is woken up, the terminal may resumeservice communication by using the channel parameter of the firstcommunication link that is obtained in the wakeup packet, therebyincreasing a networking speed when the terminal is woken up.

Based on any one of the first implementation of the first aspect of theembodiments of this application to the third implementation of the firstaspect of the embodiments of this application, in a fourthimplementation of the first aspect of the embodiments of thisapplication, before the terminal disables the first communication link,the terminal is further configured to send second notificationinformation to the relay device through the first communication link, tonotify the relay device that the RF module is to be disabled; and therelay device is further configured to: after receiving the secondnotification information, set the terminal to be in an online state onthe first communication link.

According to the standby control system provided in the embodiments ofthis application, before the terminal enters the standby mode, theterminal may send the second notification information to the relaydevice to notify the relay device that the terminal is to enter thestandby mode, so that the relay device sets a connection status of theterminal on the first communication link to an always-online statethrough parameter setting, and even if a preset time limit is exceeded,does not determine that the terminal is offline.

Based on any one of the first aspect of the embodiments of thisapplication and the first implementation of the first aspect of theembodiments of this application to the fourth implementation of thefirst aspect of the embodiments of this application, in a fifthimplementation of the first aspect of the embodiments of thisapplication, when the relay device has not received the acknowledgementinformation of the second keep-alive packet from the terminal within apreset time limit, the relay device is further configured to stopsending the first keep-alive packet to the cloud server, so that theterminal is disconnected from the cloud server.

According to the standby control system provided in the embodiments ofthis application, after the terminal enters the standby mode, when therelay device has not received the acknowledgement information of thesecond keep-alive packet from the terminal within the preset time limit,the relay device determines that the terminal is offline, and stopsperforming a cloud keep-alive operation on the terminal, in other words,sending the first keep-alive packet to the cloud server, so that therelay device is prevented from always performing a cloud service as aproxy after the terminal is offline.

Based on any one of the first aspect of the embodiments of thisapplication and the first implementation of the first aspect of theembodiments of this application to the fifth implementation of the firstaspect of the embodiments of this application, in a sixth implementationof the first aspect of the embodiments of this application, acommunication resource occupied by the acknowledgement information ofthe second keep-alive packet is smaller than a communication resourceoccupied by the second keep-alive packet.

According to the standby control system provided in the embodiments ofthis application, after entering the standby mode, the terminal keeps aheartbeat connection to the relay device by using the secondcommunication link. The relay device sends the second keep-alive packetto the terminal. The terminal receives the second keep-alive packet andreturns the acknowledgement information of the second keep-alive packet.Because the communication resource occupied by the acknowledgementinformation of the second keep-alive packet is smaller than thecommunication resource occupied by the second keep-alive packet, powerconsumption of the terminal in the standby mode can be further reduced.

Based on any one of the first aspect of the embodiments of thisapplication and the first implementation of the first aspect of theembodiments of this application to the sixth implementation of the firstaspect of the embodiments of this application, in a seventhimplementation of the first aspect of the embodiments of thisapplication, before the terminal disables the first communication link,the terminal is further configured to negotiate with the relay deviceabout a heartbeat period by using the first communication link; and therelay device is specifically configured to send the second keep-alivepacket to the terminal through the second communication link based onthe heartbeat period.

According to the standby control system provided in the embodiments ofthis application, before the terminal enters the standby mode, theterminal may further negotiate with the relay device about the heartbeatperiod by using the first communication link. Therefore, a more specificimplementation of sending the second keep-alive packet is provided, sothat the solution is more feasible. Because the second keep-alive packetis periodically sent, communication resources can be further reduced,and power consumption can be reduced.

Based on any one of the first aspect of the embodiments of thisapplication, the first implementation of the first aspect of theembodiments of this application, and the second implementation of thefirst aspect of the embodiments of this application, in an eighthimplementation of the first aspect of the embodiments of thisapplication, after a main control module of the terminal instructs thesecond communications module of the relay device to serve as a proxy toperform a keep-alive operation on the terminal in the standby mode, themain control module of the terminal negotiates with the secondcommunications module of the relay device about a heartbeat period and awakeup random number. The heartbeat period is a period of sending akeep-alive packet to the second communications module of the terminal bythe second communications module of the relay device, and the wakeuprandom number is a security verification random number used when theterminal is woken up.

According to the standby control system provided in the embodiments ofthis application, when being in the standby mode, the terminal maynegotiate with the relay device about the heartbeat period and thewakeup random number, so that the solution is more feasible.

Based on any one of the first aspect of the embodiments of thisapplication, the first implementation of the first aspect of theembodiments of this application, and the second implementation of thefirst aspect of the embodiments of this application, in a ninthimplementation of the first aspect of the embodiments of thisapplication, the wakeup packet carries at least one of a wakeup featurecode and a wakeup random number, and the wakeup feature code is a presetidentifier used to identify the wakeup packet.

According to the standby control system provided in the embodiments ofthis application, when being woken up, the terminal may obtain the atleast one of the wakeup feature code and the wakeup random number. Thewakeup random number may be used for security verification, so that awakeup process can be more secure, and the wakeup feature code may beused to identify the wakeup packet, so that the solution is morefeasible and secure.

A second aspect of the embodiments of this application provides astandby control method, including: after a standby instruction isreceived, sending first notification information to a relay devicethrough a first communication link, where the first notificationinformation is used to instruct the relay device to serve as a proxy fora terminal to send a first keep-alive packet to a cloud server, so thatthe cloud server confirms that the terminal is online; disabling thefirst communication link and a main control central processing unit(CPU); and receiving a second keep-alive packet sent by the relay devicethrough a second communication link, and returning acknowledgementinformation of the second keep-alive packet, so that the relay deviceconfirms that the terminal is online, where a communication rate of thesecond communication link is lower than a communication rate of thefirst communication link.

According to the standby control method provided in the embodiments ofthis application, the terminal is connected to the relay device throughthe first communication link. When the terminal enters a standby mode,the terminal disables the first communication link, and a secondcommunications module of the terminal performs a heartbeat keep-aliveoperation with the relay device by using the second communication link.The communication rate of the second communication link is lower thanthe communication rate of the first communication link. In comparisonwith a heartbeat keep-alive operation performed by using the firstcommunication link when the terminal is in the standby mode, in theembodiments of this application, power consumption of the terminal inthe standby mode is reduced.

Based on the second aspect of the embodiments of this application, in afirst implementation of the second aspect of the embodiments of thisapplication, after the disabling a main control central processing unitCPU, the method further includes: receiving a wakeup packet sent by therelay device through the second communication link; instructing, basedon the wakeup packet, the main control CPU to be powered on; andenabling the first communication link based on the wakeup packet.

According to the standby control method provided in the embodiments ofthis application, when being in the standby mode, the terminal receives,through the second communication link, the wakeup packet sent by therelay device, and is woken up based on the wakeup packet, to restore anormal service mode from the standby mode. Therefore, a specific mannerof waking up the terminal is provided, so that the solution is morefeasible.

Based on the second aspect of the embodiments of this application or thefirst implementation of the second aspect of the embodiments of thisapplication, in a second implementation of the second aspect of theembodiments of this application, the disabling the first communicationlink includes disabling an RF module used for high-speed datatransmission.

According to the standby control method provided in the embodiments ofthis application, disabling the first communication link by the terminalmay be disabling the RF module used for high-speed data transmission,and enabling the first communication link may also be enabling the RFmodule used for high-speed data transmission. Therefore, a method forenabling or disabling the first communication link is provided for theterminal, so that the solution is more feasible.

Based on the first implementation of the second aspect of theembodiments of this application or the second implementation of thesecond aspect of the embodiments of this application, in a thirdimplementation of the second aspect of the embodiments of thisapplication, the wakeup packet includes a channel parameter of the firstcommunication link; and the first communication link is enabled based onthe channel parameter, to perform service communication with the relaydevice through the first communication link.

According to the standby control method provided in the embodiments ofthis application, when the terminal is woken up, the terminal may resumeservice communication by using the channel parameter of the firstcommunication link that is obtained in the wakeup packet, therebyincreasing a networking speed when the terminal is woken up.

Based on any one of the second implementation of the second aspect ofthe embodiments of this application or the third implementation of thesecond aspect of the embodiments of this application, in a fourthimplementation of the second aspect of the embodiments of thisapplication, before the disabling the first communication link, themethod further includes: sending second notification information to therelay device through the first communication link, to notify the relaydevice that the RF module is to be disabled.

According to the standby control method provided in the embodiments ofthis application, before the terminal enters the standby mode, theterminal may send the second notification information to the relaydevice to notify that the terminal is to enter the standby mode, disablethe RF module, and stop transmitting data through the firstcommunication link.

Based on any one of the second aspect of the embodiments of thisapplication and the first implementation of the second aspect of theembodiments of this application to the fourth implementation of thesecond aspect of the embodiments of this application, in a fifthimplementation of the second aspect of the embodiments of thisapplication, a communication resource occupied by the acknowledgementinformation of the second keep-alive packet is smaller than acommunication resource occupied by the second keep-alive packet.

According to the standby control method provided in the embodiments ofthis application, after entering the standby mode, the terminal keeps aheartbeat connection to the relay device by using the secondcommunication link. The relay device sends the second keep-alive packetto the terminal. The terminal receives the second keep-alive packet andreturns the acknowledgement information of the second keep-alive packet.Because the communication resource occupied by the acknowledgementinformation of the second keep-alive packet is smaller than thecommunication resource occupied by the second keep-alive packet, powerconsumption of the terminal in the standby mode can be further reduced.

Based on the second aspect of the embodiments of this application andthe first implementation of the second aspect of the embodiments of thisapplication to the fifth implementation of the second aspect of theembodiments of this application, in a sixth implementation of the secondaspect of the embodiments of this application, before the disabling thefirst communication link, the method further includes: negotiating withthe relay device about a heartbeat period by using the firstcommunication link; and the receiving a second keep-alive packet sent bythe relay device through a second communication link specificallyincludes: receiving the second keep-alive packet sent by the relaydevice through the second communication link based on the heartbeatperiod.

According to the standby control method provided in the embodiments ofthis application, before the terminal enters the standby mode, theterminal may further negotiate with the relay device about the heartbeatperiod by using the first communication link. Therefore, a more specificimplementation of the heartbeat connection is provided, so that thesolution is more flexible.

A third aspect of the embodiments of this application provides a standbycontrol method, including: receiving first notification information sentby a terminal through a first communication link; under an instructionof the first notification information, serving as a proxy for theterminal to send a first keep-alive packet to a cloud server, so thatthe cloud server confirms that the terminal is online; sending a secondkeep-alive packet to the terminal through a second communication link;and receiving, through the second communication link, acknowledgementinformation that is of the second keep-alive packet and that is returnedby the terminal, and confirming, based on the acknowledgementinformation, that the terminal is online, where a communication rate ofthe second communication link is lower than a communication rate of thefirst communication link.

According to the standby control method provided in the embodiments ofthis application, a relay device may keep a connection to the terminalby using the first communication link, and transmit business servicedata. When the terminal enters a standby mode, the terminal disables thefirst communication link, and a second communications module of therelay device performs a heartbeat keep-alive operation with a secondcommunications module of the terminal by using the second communicationlink. The communication rate of the second communication link is lowerthan the communication rate of the first communication link. Incomparison with a heartbeat keep-alive operation performed by using thefirst communication link when the terminal is in the standby mode, inthe embodiments of this application, power consumption of the terminalin the standby mode is reduced.

Based on the third aspect of the embodiments of this application, in afirst implementation of the third aspect of the embodiments of thisapplication, the method further includes: sending a wakeup packet to theterminal through the second communication link, so that the terminalenables a main control CPU and the first communication link based on thewakeup packet.

According to the standby control method provided in the embodiments ofthis application, when the terminal is in the standby mode, the relaydevice may send the wakeup packet to the terminal through the secondcommunication link, to wake up the terminal. Therefore, a specificmanner of waking up the terminal is provided, so that the solution ismore feasible.

Based on the first implementation of the third aspect of the embodimentsof this application, in a second implementation of the third aspect ofthe embodiments of this application, the enabling the firstcommunication link includes enabling an RF module used for high-speeddata transmission.

According to the standby control method provided in the embodiments ofthis application, disabling the first communication link by the terminalmay be disabling the RF module used for high-speed data transmission,and enabling the first communication link may also be enabling the RFmodule used for high-speed data transmission. Therefore, a method forenabling or disabling the first communication link is provided, so thatthe solution is more feasible.

Based on the first implementation of the third aspect of the embodimentsof this application or the second implementation of the third aspect ofthe embodiments of this application, in a third implementation of thethird aspect of the embodiments of this application, the wakeup packetincludes a channel parameter of the first communication link; and afterthe terminal enables the first communication link based on the channelparameter, service communication is performed with the terminal throughthe first communication link.

According to the standby control method provided in the embodiments ofthis application, when waking up the terminal, the relay device may addthe channel parameter of the first communication link to the wakeuppacket to resume service communication, thereby increasing a networkingspeed when the terminal is woken up.

Based on any one of the third aspect of the embodiments of thisapplication, the first implementation of the third aspect of theembodiments of this application, or the third implementation of thethird aspect of the embodiments of this application, in a fourthimplementation of the third aspect of the embodiments of thisapplication, before the sending a second keep-alive packet to theterminal through a second communication link, the method furtherincludes: receiving second notification information sent by the terminalthrough the first communication link; and setting, based on the secondnotification information, the terminal to be in a connected state on thefirst communication link.

According to the standby control method provided in the embodiments ofthis application, before the terminal enters the standby mode, the relaydevice may receive, through the first communication link, the secondnotification information sent by the terminal, and set a connectionstatus of the terminal on the first communication link to analways-online state through parameter setting, so that even if a presettime limit is exceeded, the relay device does not determine that theterminal is offline.

Based on any one of the third aspect of the embodiments of thisapplication, the first implementation of the third aspect of theembodiments of this application, or the fourth implementation of thethird aspect of the embodiments of this application, in a fifthimplementation of the third aspect of the embodiments of thisapplication, when the acknowledgement information that is of the secondkeep-alive packet and that is returned by the terminal has not beenreceived within a preset time limit, sending the first keep-alive packetto the cloud server is stopped, so that the terminal is disconnectedfrom the cloud server.

According to the standby control method provided in the embodiments ofthis application, after the terminal enters the standby mode, when therelay device has not received the acknowledgement information of thesecond keep-alive packet from the terminal within the preset time limit,the relay device determines that the terminal is offline, and stopsperforming a cloud keep-alive operation on the terminal, in other words,sending the first keep-alive packet to the cloud server, so that therelay device is prevented from always performing a cloud service as aproxy after the terminal is offline.

Based on any one of the third aspect of the embodiments of thisapplication, the first implementation of the third aspect of theembodiments of this application, or the fifth implementation of thethird aspect of the embodiments of this application, in a sixthimplementation of the third aspect of the embodiments of thisapplication, a communication resource occupied by the acknowledgementinformation of the second keep-alive packet is smaller than acommunication resource occupied by the second keep-alive packet.

According to the standby control method provided in the embodiments ofthis application, after the terminal enters the standby mode, the relaydevice keeps a heartbeat connection to the terminal by using the secondcommunication link. The relay device sends the second keep-alive packetto the terminal. The terminal receives the second keep-alive packet andreturns the acknowledgement information of the second keep-alive packet.Because the communication resource occupied by the acknowledgementinformation of the second keep-alive packet is smaller than thecommunication resource occupied by the second keep-alive packet, powerconsumption of the terminal in the standby mode can be further reduced.

Based on any one of the third aspect of the embodiments of thisapplication, the first implementation of the third aspect of theembodiments of this application, or the sixth implementation of thethird aspect of the embodiments of this application, in a seventhimplementation of the third aspect of the embodiments of thisapplication, before the sending a second keep-alive packet to theterminal through a second communication link, the method furtherincludes: negotiating with the terminal about a heartbeat period byusing the first communication link; and the sending a second keep-alivepacket to the terminal through a second communication link specificallyincludes: sending the second keep-alive packet to the terminal throughthe second communication link based on the heartbeat period.

According to the standby control method provided in the embodiments ofthis application, before the terminal enters the standby mode, the relaydevice may further negotiate with the terminal about the heartbeatperiod by using the first communication link. Therefore, a more specificimplementation of sending the second keep-alive packet is provided, sothat the solution is more feasible. Because the second keep-alive packetis periodically sent, communication resources can be further reduced,and power consumption can be reduced.

A fourth aspect of the embodiments of this application provides aterminal, including a main control module, a first communicationsmodule, and a second communications module. The main control module isconfigured to: after a standby instruction is received, control thefirst communications module to send first notification information to arelay device through a first communication link. The first notificationinformation is used to instruct the relay device to serve as a proxy forthe terminal to send a first keep-alive packet to a cloud server, andthe first communication link is a communication link between the firstcommunications module and the relay device. The main control module isfurther configured to disable the first communication link and a maincontrol central processing unit (CPU). The second communications moduleis configured to: receive a second keep-alive packet sent by the relaydevice through a second communication link, and return acknowledgementinformation of the second keep-alive packet, so that the relay deviceconfirms that the terminal is online. The second communication link is acommunication link between the second communications module and therelay device, and a communication rate of the second communication linkis lower than a communication rate of the first communication link.

The terminal provided in the embodiments of this application isconnected to the relay device through the first communication link. Whenthe terminal enters a standby mode, the terminal disables the firstcommunication link, and the second communications module of the terminalperforms a heartbeat keep-alive operation with the relay device by usingthe second communication link. The communication rate of the secondcommunication link is lower than the communication rate of the firstcommunication link. In comparison with a heartbeat keep-alive operationperformed by using the first communication link when the terminal is inthe standby mode, in the embodiments of this application, powerconsumption of the terminal in the standby mode is reduced.

Based on the fourth aspect of the embodiments of this application, in afirst implementation of the fourth aspect of the embodiments of thisapplication, the second communications module is further configured to:receive a wakeup packet sent by the relay device through the secondcommunication link; instruct, based on the wakeup packet, the maincontrol module to enable the CPU; and instruct, based on the wakeuppacket, the main control module to enable the first communication link.

According to the terminal provided in the embodiments of thisapplication, when the terminal is in the standby mode, the secondcommunications module receives, through the second communication link,the wakeup packet sent by the relay device, and is woken up based on thewakeup packet, to restore a normal service mode from the standby mode.Therefore, a specific manner of waking up the terminal is provided, sothat the solution is more feasible.

Based on the fourth aspect of the embodiments of this application or thefirst implementation of the fourth aspect of the embodiments of thisapplication, the disabling the first communication link includes:disabling, by the first communications module, an RF module used forhigh-speed data transmission.

According to the terminal provided in the embodiments of thisapplication, disabling the first communication link by the terminal maybe disabling the RF module used for high-speed data transmission, andenabling the first communication link may also be enabling the RF moduleused for high-speed data transmission. Therefore, a method for enablingor disabling the first communication link is provided for the terminal,so that the solution is more feasible.

Based on the first implementation of the fourth aspect of theembodiments of this application or the second implementation of thefourth aspect of the embodiments of this application, in a thirdimplementation of the fourth aspect of the embodiments of thisapplication, the wakeup packet includes a channel parameter of the firstcommunication link; and the first communications module is furtherconfigured to enable the first communication link based on the channelparameter, to perform service communication with the relay devicethrough the first communication link.

According to the terminal provided in the embodiments of thisapplication, when the terminal is woken up, the terminal may resumeservice communication by using the channel parameter of the firstcommunication link that is obtained in the wakeup packet, therebyincreasing a networking speed when the terminal is woken up.

Based on the second implementation of the fourth aspect of theembodiments of this application or the third implementation of thefourth aspect of the embodiments of this application, in a fourthimplementation of the fourth aspect of the embodiments of thisapplication, the main control module is further configured to sendsecond notification information to the relay device through the firstcommunication link, to notify the relay device that the RF module is tobe disabled.

According to the terminal provided in the embodiments of thisapplication, before the terminal enters the standby mode, the maincontrol module may send the second notification information to the relaydevice through the first communication link, to notify that the terminalis to enter the standby mode, disable the RF module, and stoptransmitting data through the first communication link.

Based on the fourth aspect of the embodiments of this application andthe first implementation of the fourth aspect of the embodiments of thisapplication to the fourth implementation of the fourth aspect of theembodiments of this application, in a fifth implementation of the fourthaspect of the embodiments of this application, the main control moduleis further configured to negotiate with the relay device about aheartbeat period by using the first communication link; and the secondcommunications module is specifically configured to receive the secondkeep-alive packet sent by the relay device through the secondcommunication link based on the heartbeat period.

According to the terminal provided in the embodiments of thisapplication, before the terminal enters the standby mode, the maincontrol module may further negotiate with the relay device about theheartbeat period by using the first communication link. Therefore, amore specific implementation of a heartbeat connection is provided, sothat the solution is more flexible.

A fifth aspect of the embodiments of this application provides a relaydevice, including a first communications module and a secondcommunications module. The first communications module is configured toreceive first notification information sent by a terminal through afirst communication link. The first communications module is furtherconfigured to serve as a proxy for the terminal to send a firstkeep-alive packet to a cloud server, so that the cloud server confirmsthat the terminal is online. The second communications module isconfigured to send a second keep-alive packet to the terminal through asecond communication link. The second communications module is furtherconfigured to: receive, through the second communication link,acknowledgement information that is of the second keep-alive packet andthat is returned by the terminal, and confirm, based on theacknowledgement information, that the terminal is online. Acommunication rate of the second communication link is lower than acommunication rate of the first communication link.

According to the relay device provided in the embodiments of thisapplication, the relay device may keep a connection to the terminal byusing the first communication link, and transmit business service data.When the terminal enters a standby mode, the terminal disables the firstcommunication link, and the second communications module of the relaydevice performs a heartbeat keep-alive operation with a secondcommunications module of the terminal by using the second communicationlink. The communication rate of the second communication link is lowerthan the communication rate of the first communication link. Incomparison with a heartbeat keep-alive operation performed by using thefirst communication link when the terminal is in the standby mode, inthe embodiments of this application, power consumption of the terminalin the standby mode is reduced.

Based on the fifth aspect of the embodiments of this application, in afirst implementation of the fifth aspect of the embodiments of thisapplication, the second communications module is further configured tosend a wakeup packet to the terminal through the second communicationlink, so that the terminal enables a main control CPU and the firstcommunication link based on the wakeup packet.

According to the relay device provided in the embodiments of thisapplication, when the terminal is in the standby mode, the secondcommunications module may send the wakeup packet to the terminal throughthe second communication link, to wake up the terminal. Therefore, aspecific manner of waking up the terminal is provided, so that thesolution is more feasible.

Based on the first implementation of the fifth aspect of the embodimentsof this application, in a second implementation of the fifth aspect ofthe embodiments of this application, the enabling the firstcommunication link includes enabling an RF module used for high-speeddata transmission.

According to the relay device provided in the embodiments of thisapplication, disabling the first communication link by the terminal maybe disabling the RF module used for high-speed data transmission, andenabling the first communication link may also be enabling the RF moduleused for high-speed data transmission. Therefore, a method for enablingor disabling the first communication link is provided, so that thesolution is more feasible.

Based on the first implementation of the fifth aspect of the embodimentsof this application or the second implementation of the fifth aspect ofthe embodiments of this application, in a third implementation of thefifth aspect of the embodiments of this application, the wakeup packetincludes a channel parameter of the first communication link; and thefirst communications module is further configured to: after the terminalenables the first communication link based on the channel parameter,perform service communication with the terminal through the firstcommunication link.

According to the relay device provided in the embodiments of thisapplication, when waking up the terminal, the relay device may add thechannel parameter of the first communication link to the wakeup packetto resume service communication, thereby increasing a networking speedwhen the terminal is woken up.

Based on the fifth aspect of the embodiments of this application, thefirst implementation of the fifth aspect of the embodiments of thisapplication, or the third implementation of the fifth aspect of theembodiments of this application, in a fourth implementation of the fifthaspect of the embodiments of this application, the first communicationsmodule is further configured to: receive second notification informationsent by the terminal through the first communication link, to learn thatthe terminal is to disable the RF module; and set, based on the secondnotification information, the terminal to be in an online state on thefirst communication link.

According to the relay device provided in the embodiments of thisapplication, before the terminal enters the standby mode, the firstcommunications module may receive, through the first communication link,the second notification information sent by the terminal, and set aconnection status of the terminal on the first communication link to analways-online state through parameter setting, so that even if a presettime limit is exceeded, the relay device does not determine that theterminal is offline.

Based on the fifth aspect of the embodiments of this application, thefirst implementation of the fifth aspect of the embodiments of thisapplication, or the fourth implementation of the fifth aspect of theembodiments of this application, in a fifth implementation of the fifthaspect of the embodiments of this application, the first communicationsmodule is further configured to: when the second communications modulehas not received, within a preset time limit, the acknowledgementinformation that is of the second keep-alive packet and that is returnedby the terminal, stop sending the first keep-alive packet to the cloudserver, so that the terminal is disconnected from the cloud server.

According to the relay device provided in the embodiments of thisapplication, after the terminal enters the standby mode, when the relaydevice has not received the acknowledgement information of the secondkeep-alive packet from the terminal within the preset time limit, therelay device determines that the terminal is offline, and the firstcommunications module stops performing a cloud keep-alive operation onthe terminal, in other words, sending the first keep-alive packet to thecloud server, so that the relay device is prevented from alwaysperforming a cloud service as a proxy after the terminal is offline.

Based on the fifth aspect of the embodiments of this application, thefirst implementation of the fifth aspect of the embodiments of thisapplication, or the fifth implementation of the fifth aspect of theembodiments of this application, in a sixth implementation of the fifthaspect of the embodiments of this application, the second communicationsmodule is further configured to: before the second communications modulesends the second keep-alive packet to the terminal through the secondcommunication link, negotiate with the terminal about a heartbeat periodby using the first communication link; and the second communicationsmodule is further configured to send the second keep-alive packet to theterminal through the second communication link based on the heartbeatperiod.

According to the relay device provided in the embodiments of thisapplication, after the terminal enters the standby mode, the secondcommunications module keeps a heartbeat connection to the terminal byusing the second communication link. The relay device sends the secondkeep-alive packet to the terminal. The terminal receives the secondkeep-alive packet and returns the acknowledgement information of thesecond keep-alive packet. Because a communication resource occupied bythe acknowledgement information of the second keep-alive packet issmaller than a communication resource occupied by the second keep-alivepacket, power consumption of the terminal in the standby mode can befurther reduced.

A sixth aspect of the embodiments of this application provides aterminal. The terminal includes a processor and a memory, and theprocessor performs, by running a software program stored in the memoryand invoking data stored in the memory, the method in theimplementations provided in the second aspect of the embodiments of thisapplication.

A seventh aspect of the embodiments of this application provides a relaydevice. The relay device includes a processor and a memory, and theprocessor performs, by running a software program stored in the memoryand invoking data stored in the memory, the method in theimplementations provided in the third aspect of the embodiments of thisapplication.

An eighth aspect of the embodiments of this application provides acomputer program product. The computer program product includes acomputer program instruction, and the computer program instruction maybe loaded by using a processor to implement the method in the secondaspect and the implementations of the second aspect.

A ninth aspect of the embodiments of this application provides acomputer program product. The computer program product includes acomputer program instruction, and the computer program instruction maybe loaded by using a processor to implement the method in the thirdaspect and the implementations of the third aspect.

A tenth aspect of the embodiments of this application provides acomputer storage medium, configured to store a computer programinstruction. The computer program instruction includes programs used toperform the steps in the implementations provided in the second aspectof the embodiments of this application.

An eleventh aspect of the embodiments of this application provides acomputer storage medium, configured to store a computer programinstruction. The computer program instruction includes programs used toperform the steps in the implementations provided in the third aspect ofthe embodiments of this application.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a terminal in a standby mode;

FIG. 2 is a diagram of a terminal networking architecture according toan embodiment of this application;

FIG. 3 is a schematic diagram of a layering model of a terminalaccording to an embodiment of this application;

FIG. 4 is a schematic diagram of a layering model of a relay deviceaccording to an embodiment of this application;

FIG. 5 is an interaction flowchart of a standby control method accordingto an embodiment of this application;

FIG. 6 is another interaction flowchart of a standby control methodaccording to an embodiment of this application;

FIG. 7 is a schematic diagram of an embodiment of a terminal accordingto the embodiments of this application; and

FIG. 8 is a schematic diagram of an embodiment of a relay deviceaccording to the embodiments of this application.

DESCRIPTION OF EMBODIMENTS

It should be understood that, in this application, “at least one” meansone or more, and “a plurality of” means two or more. The term “and/or”is used to describe an association relationship between associatedobjects, and indicates that three relationships may exist. For example,“A and/or B” may indicate the following three cases: Only A exists, onlyB exists, and both A and B exist, where A and B may be singular orplural. The character “/” generally indicates an “or” relationshipbetween the associated objects. “at least one of the following” or asimilar expression thereof indicates any combination of the items,including any combination of one or more of the items. For example, atleast one of a, b, and c may indicate a, b, c, “a and b”, “a and c”, “band c”, or “a, b, and c”, where a, b, and c may be singular or plural.

The embodiments of this application provide a standby control method, toreduce power consumption of a terminal in a standby mode.

FIG. 1 is a schematic diagram of a terminal in a standby mode. In acommon terminal standby method, the terminal communicates with a routerby using a network communications module. The terminal mainly includes amain control central processing unit (CPU) and the networkcommunications module. When the terminal is in the standby mode, themain control CPU is in a power-off state, and the network communicationsmodule keeps a heartbeat connection to the router, so that quicknetworking and remote wakeup can be supported. When the terminal is inthe standby mode, the network communications module keeps a heartbeatconnection to the router. Therefore, power consumption is relativelyhigh.

FIG. 2 is a diagram of a terminal networking architecture according toan embodiment of this application. The architecture may be used in ascenario such as terminal video data transmission. In this embodiment ofthis application, a relay device is added to the terminal networkingarchitecture, a terminal is communicatively connected to a router byusing the relay device, and the terminal is communicatively connected tothe cloud by using the relay device and the router.

A composition structure of the terminal mainly includes a main controlCPU, a wireless fidelity (Wi-Fi) module, a microcontroller unit (MCU), apower management unit (PMU), and a radio frequency (RF) module. The RFmodule is added to the structure of the terminal in this embodiment ofthis application.

For example, the main control CPU, which may be, for example, a cameraCPU or a set-top-box CPU, is responsible for running media services suchas a login service, a push service, and an on-demand service.Optionally, the main control CPU may include at least one of thefollowing types: a general-purpose central processing unit, a digitalsignal processor (DSP), a microprocessor, or a microcontroller unit(MCU). For example, the main control CPU may be a single-CPU processoror a multi-CPU processor. Alternatively, the main control CPU may be aprocessor group including a plurality of processors, and the pluralityof processors are coupled to each other through one or more buses. Themain control CPU may include an analog-to-digital converter (ADC) and adigital-to-analog converter (DAC) to implement a signal connectionbetween different components of the apparatus. The MCU is used for powercontrol and external event detection. The PMU can supply power to themain control CPU and the modules of the terminal. The Wi-Fi module,namely, a high-speed communications module, may be the 4th generationmobile communication technology (4G) wireless module or the like. TheWi-Fi module is configured to perform service communication. Forexample, a network communications module may include a centralprocessing unit CPU or a microcontroller unit MCU and a radio frequencytransceiver (which may also be referred to as a radio frequencycircuit).

The RF module is a wakeup module, for example, may be a Bluetoothmodule. The RF module is configured to send a keep-alive packet to therelay device when the terminal is in a standby mode, to keep a heartbeatconnection to the relay device, and may further receive a wakeup packetsent by the relay device, to wake up the terminal in the standby mode.Power consumption of the RF module is lower than that of the Wi-Fimodule. Reasons for low power consumption of the RF module may be asfollows: Bandwidth of a monitored frequency is narrow, an amount ofcarried data is small, and therefore low energy consumption is required.A protocol is simple, logic processing of a chip is simple, and powerconsumption is low. It should be noted that the RF module of theterminal may be integrated into the terminal or separately exist asexternal hardware. It should be understood that, when the RF module ofthe terminal separately exists as external hardware, in an optionalcase, the RF module of the terminal may be connected to the terminalthrough a serial peripheral interface (SPI).

A composition structure of the relay device mainly includes a maincontrol CPU, a Wi-Fi module, an MCU, and an RF module.

A proxy module of the relay device is further disposed in the structureof the relay device. The proxy module may be integrated into the Wi-Fimodule of the relay device, or may be implemented in a module other thanthe Wi-Fi module of the relay device. Functions of the proxy module ofthe relay device include a cloud service keep-alive function, remoteterminal wakeup, terminal IP address and router DHCP lease renewal, andthe like.

The main control CPU of the relay device may be configured to beresponsible for running a media service. The Wi-Fi module, namely, anetwork communications module, is a high-speed communications module,and may be a 4G wireless module or the like. The Wi-Fi module isconfigured to perform service communication with the terminal. The RFmodule is a wakeup module, and may be a Bluetooth module or the like.The RF module is configured to: keep a heartbeat connection to theterminal when the terminal is in the standby mode, and send a wakeuppacket to the RF module of the terminal to remotely wake up theterminal. It should be noted that the RF module of the relay device maybe integrated into the relay device or separately exist as externalhardware. It should be understood that, when the RF module of the relaydevice separately exists as external hardware, in an optional case, theRF module of the relay device may be connected to the relay devicethrough a serial peripheral interface.

It should be understood that each of the Wi-Fi module of the terminaland the Wi-Fi module of the relay device includes an RF module, and anamount of data transmitted by the RF module of the Wi-Fi module in aunit time is large. In an optional case, the amount of data transmittedby the RF module of the Wi-Fi module in a unit time is greater than 10M. However, an amount of data that can be transmitted, in a unit time,by the RF module used for a wake-up function is small. In an optionalcase, the amount of data transmitted, in a unit time, by the RF moduleused for the wakeup function is less than 1 M.

In the terminal networking architecture in this embodiment of thisapplication, when the terminal is in a normal service mode, both themain control CPU and the Wi-Fi module are in a power-on state, theterminal is connected to and communicates with the router and the cloudbased on a first communication link by using the Wi-Fi module, and theRF module is in the standby mode or powered off. When the terminalenters the standby mode, the main control CPU of the terminal is poweredoff, and power is not supplied to most function modules of the Wi-Fimodule. For example, the network communications module disables theradio frequency module and stops transceiving data, power is suppliedonly to some modules to maintain memory refresh, and the terminal keepsa heartbeat connection to the relay device based on a secondcommunication link by using the RF module, and keeps a connection to thecloud by using the relay device. In this case, the Wi-Fi module is in anultra-low power consumption mode. Because the power consumption of theRF module is lower than that of the Wi-Fi module, in comparison with aheartbeat connection performed by the terminal by using the Wi-Fi modulein the prior art, power consumption of the terminal in the standby modeis reduced. In an optional case, the first communication link is awireless Wi-Fi communication link, and has a high transmission rate, andthe second communication link is an RF communication link, and has a lowtransmission rate. Compared with the first communication link, thesecond communication link corresponds to a new air interface and isbased on a simple data protocol. For example, the simple data protocolis attributed to low carrier complexity and low protocol transmissioncomplexity.

FIG. 3 is a schematic diagram of a layering model of a terminalaccording to an embodiment of this application.

The terminal includes a main control CPU, a network communicationsmodule, and a wakeup module. The main control CPU module and the networkcommunications module may be connected through a peripheral interface,namely, secure digital input/output (SDIO). The SDIO interface may beused to transmit a data block. The main control CPU and the wakeupmodule may be connected through a serial interface, and the networkcommunications module and the wakeup module may be connected throughgeneral purpose input/output (GPIO).

The main control CPU may include a service layer, a middleware layer, anoperating system (OS) layer, a driver layer, and a hardware layer. Thedriver layer is an interface of the hardware layer. The OS layer cancontrol working of the hardware device only by using the driver layer.

A standby function of the service layer may include a function used forterminal standby control. An RTOS of the OS layer is a real-timeoperating system (RTOS). Serial interfaces of the driver layer and thehardware layer are jointly connected to the wakeup module.

The network communications module may include a service layer, a driverlayer, and a hardware layer. The service layer includes standby andwakeup functions, and may be used for terminal standby control. A GPIOdriver of the driver layer is used to perform a GPIO connection to thewakeup module, and an SDIO driver is used to connect to the main controlCPU to transmit a data block through an SDIO interface. RF TX of thehardware layer is a radio frequency transmission unit, and RF RX is aradio frequency receiving unit.

The wakeup module may include a service layer, a driver layer, and ahardware layer. The service layer may complete a low power consumptionfunction, a keep-alive function, and a wakeup function, used to: duringterminal standby control, perform a heartbeat keep-alive operationbetween the terminal and a relay device by using the wakeup module and asecond communication link, and maintain a low power consumptionconnection between the terminal and the relay device; or when theterminal is woken up by the cloud, receive a wakeup packet through asecond communication link by using the wakeup module to wake up theterminal. A serial interface of the driver layer is used to control aconnection between the hardware and the main control CPU. 433 M RF ofthe hardware layer is a radio frequency module with a frequency of 433megabytes, used to establish the second communication link with therelay device to perform a heartbeat keep-alive operation when theterminal is in a standby mode.

The main control CPU module, the network communications module, and thewakeup module of the terminal may implement the standby control methodin the embodiments of this application by using the layering model. Forspecific steps performed by the terminal, refer to the embodimentcorresponding to FIG. 6.

The foregoing describes the schematic diagram of the layering model ofthe terminal in the embodiments of this application. With reference toFIG. 4, the following describes a schematic diagram of layering model ofa relay device in the embodiments of this application.

The relay device includes a main control CPU module, a networkcommunications module, and a wakeup module. The network communicationsmodule and the wakeup module may be connected through a serialinterface.

The network communications module of the relay device may include aservice layer, an OS layer, a driver layer, and a hardware layer. Thedriver layer is an interface of the hardware layer. The OS layer cancontrol working of the hardware device only by using the driver layer.

HOSTAPD of the service layer of the relay device may complete twofunctions in a standby control method: (1) obtaining a channel parameterand a device IP parameter from the network communications module; and(2) setting a device online non-timeout function. A cloud keep-aliveproxy may serve as a proxy for a terminal to send a first keep-alivepacket to the relay device. By using a dynamic host configurationprotocol (DHCP) proxy, the relay device sends a DHCP lease renewalpacket to a router, to renew an IP address lease. A gratuitous addressresolution protocol (ARP) proxy sends an ARP packet or the like to therouter to keep a connection to the router, preventing an ARP table ofthe router from aging. An RTOS of the OS layer is a real-time operatingsystem.

The wakeup module may include a service layer, a driver layer, and ahardware layer. An RTOS is a real-time operating system (RTOS), RF is aradio frequency module, 433 M RF is a radio frequency module with afrequency of 433 megabytes, RF TX is a radio frequency transmissionunit, and RF RX is a radio frequency receiving unit. Parametermanagement of the service layer is used to negotiate about a parameterrelated to a keep-alive operation and a heartbeat period and construct awakeup packet. RF of the driver layer is used to drive the RF module tosend a keep-alive packet or a wakeup packet through a secondcommunication link.

The network communications module and the wakeup module of the relaydevice may implement the standby control method in the embodiments ofthis application by using the layering model. For specific stepsperformed by the relay device, refer to the embodiment corresponding toFIG. 6.

Based on the diagram of the terminal networking architecture in FIG. 2,the following describes a standby control method provided in anembodiment of this application. FIG. 5 is an interaction flowchart of astandby control method according to an embodiment of this application.

When a terminal enters a standby mode, a main control CPU is poweredoff, and a network communications module (which, for example, may be aWi-Fi module, namely, a high-speed communications module) disables an RFmodule used for high-speed data transmission and stops transceivingdata, and only a small amount of power is retained to maintain memoryrefresh of the Wi-Fi module. Instead of the Wi-Fi module used forhigh-speed communication, an RF module used for low-speed communicationperiodically sends a keep-alive packet to a relay device through alow-speed communication link, so that the terminal keeps a heartbeatconnection to a cloud server by using the relay device. Therefore,before entering the standby mode, the terminal needs to negotiate withthe relay device about preparations required for a keep-alive operation.

The standby control method specifically includes the following steps.

Step 1: After receiving a standby instruction, the terminal enters thestandby mode, and sends first notification information to the relaydevice through a first communication link, where the first notificationinformation is used to instruct the relay device to serve as a proxy forthe terminal to send a first keep-alive packet to the cloud server afterthe terminal enters the standby mode, to notify the cloud server thatthe terminal is still alive. Optionally, the keep-alive packet may alsobe referred to as a heartbeat packet. It should be understood that aheartbeat usually refers to sending a custom instruction to one of twocommunication parties by the other party to determine whether the partyis alive, and the keep-alive packet is usually sent at specificintervals, which is similar to a heartbeat, and therefore, is furtherreferred to as a heartbeat instruction.

For example, the first communication link is a wireless Wi-Ficommunication link between the Wi-Fi module, namely, the high-speedcommunications module, of the terminal and a Wi-Fi module, namely, ahigh-speed communications module, of the relay device, and the firstcommunication link is a high-speed communication link. When being in anormal service mode, the terminal performs service and datacommunication with the cloud server through the first communicationlink. For example, the relay device keeps a connection to a router bysending a DHCP lease renewal packet, an ARP packet, and the like to therouter, and further keeps a connection to the cloud server by using therouter. The DHCP lease renewal packet may be used to renew an IP addresslease, and the gratuitous ARP packet is used to prevent an ARP table ofthe router from aging. In an optional case, the relay deviceperiodically sends the DHCP lease renewal packet and the gratuitous ARPpacket to the router, and a sending period may be 30 seconds to 60seconds. Because always sending a keep-alive packet excessively wastesresources and increases system power consumption, in this embodiment ofthis application, a keep-alive packet is periodically sent, properlyreducing system power consumption while ensuring that the relay devicekeeps a connection to the cloud server. It should be understood that therouter has an aging period, and feature information (for example, an ARPtable and a NAT table) of the terminal that is stored in the router iscleared each time the aging period is reached. To prevent the routerfrom aging, the period of sending the DHCP lease renewal packet and thegratuitous ARP packet to the router by the relay device needs to beshorter than the aging period of the router. The period of sending thepacket to the router by the relay device is not specifically limited inthis embodiment of this application.

For example, the relay device serves as a proxy for the terminal to senda cloud keep-alive packet to the cloud server, so that the cloud serverconsiders that the terminal is connected to the cloud server.Optionally, a period of sending the cloud keep-alive packet by the relaydevice may be 30 seconds to 60 seconds.

Step 2: The terminal negotiates with the relay device about a standbyparameter, a wakeup parameter, and the like by using the firstcommunication link.

For example, the standby parameter includes a period of sending aterminal keep-alive packet to the terminal by the relay device when theterminal is in the standby mode. Optionally, the keep-alive packet mayalso be referred to as a heartbeat packet. For example, the period ofsending the terminal keep-alive packet to the terminal by the relaydevice when the terminal is in the standby mode may be 5 seconds to 10seconds. However, a specific value of the heartbeat period is notspecifically limited in this embodiment of this application.

For example, the wakeup parameter may include parameters such as awakeup random code and a wakeup random number. The wakeup random numberis a verification random number used when the terminal is woken up fromthe standby mode, and performing verification on the wakeup randomnumber by the terminal can improve security of a wakeup process.

Step 3: The terminal sends second notification information to the relaydevice by using the first communication link, where the secondnotification information is used to notify the relay device that theterminal is to disable the RF module of the Wi-Fi module used forhigh-speed transmission, and the relay device enables a device onlinenon-timeout function, in other words, the relay device does not limitonline duration of the terminal, and keeps a connection to the terminalfor network communication. The online non-timeout function may mean thatthe relay device sets a related parameter, so that even if servicecommunication has not been performed within a preset time limit, therelay device does not determine that the terminal is in an offlinestate.

Step 4: The terminal disables the RF module of the Wi-Fi module used forhigh-speed transmission.

It should be understood that, when the terminal is in the normal servicemode, the Wi-Fi module used for high-speed transmission completes anetwork communication function including data and informationtransmission. The Wi-Fi module includes an MCU, an RF transmitter, an RFreceiver, and the like. When the terminal enters the standby mode, toreduce as much power consumption of the terminal as possible, the RFmodule used for high-speed data transmission is disabled, datatransceiving is stopped, and only a small amount of power is retained tomaintain memory refresh of the Wi-Fi module. In this case, the Wi-Fimodule of the terminal is in an ultra-low power consumption mode. In anoptional case, a working current of the Wi-Fi module in the ultra-lowpower consumption mode is only approximately 10 microamperes to 20microamperes. It should be understood that the ultra-low powerconsumption mode is different from a power-off mode. Because a memory ofthe Wi-Fi module is always refreshed, the Wi-Fi module of the terminalcan quickly restore the normal service mode when there is a servicerequirement.

Step 5: The terminal powers off the main control CPU, and the terminalenters the standby mode.

Step 6: The terminal receives and acknowledges, through a secondcommunication link, the terminal keep-alive packet sent by the relaydevice.

For example, after the terminal enters the standby mode, the RF moduleused for low-speed communication receives, through the secondcommunication link, the terminal keep-alive packet sent by the relaydevice, and sends an acknowledgement packet to the relay device.Optionally, the acknowledgement packet sent by the terminal to the relaydevice may be an acknowledgement (ACK) packet. The ACK packet is simplein form, and usually occupies only 4 or 8 bytes, but a normal keep-alivepacket (for example, the cloud keep-alive packet and the terminalkeep-alive packet sent by the relay device) needs to occupy dozens ofbytes. It should be understood that, to further reduce power consumptionof the terminal in the standby mode, the relay device sends a keep-alivepacket to the terminal, and the terminal only needs to send anacknowledgement packet in a simpler form. In other words, the relaydevice queries, by using the keep-alive packet, whether the terminal isonline. The terminal only needs to answer yes. Therefore,acknowledgement information is simpler and power consumption is lower.When the relay device cannot receive an acknowledgement from theterminal, the relay device considers that the terminal is in an offlinestate. In this case, the relay device stops sending the cloud keep-alivepacket to the cloud server, and the terminal is disconnected from thecloud server. When the relay device receives an acknowledgement from theterminal, the relay device considers that the terminal is in an onlinestate, and sends the cloud keep-alive packet to the cloud server, sothat a connection between the terminal and the cloud server is kept.

Optionally, the relay device periodically sends the terminal keep-alivepacket to the terminal. For example, a sending period may be obtainedthrough negotiation in step 2. In an optional case, to minimize a timerequired for waking up the terminal and to enable the terminal to berestored to the normal service mode as soon as possible when there is aservice requirement, the low-speed RF module of the terminal starts onceevery 0.5 seconds to 1 second, to receive and acknowledge a wakeuppacket or a keep-alive packet.

In an optional case, when the terminal is in the standby mode, a workingcurrent of the low-speed RF module is 30 microamperes to 40microamperes, which is significantly lower than a working current ofapproximately 300 microamperes to 400 microamperes when the terminalperforms a heartbeat keep-alive operation by using the high-speed Wi-Fimodule.

Step 7: The cloud server sends a first wakeup packet to the relaydevice.

When the terminal needs to be woken up, the cloud constructs the firstwakeup packet and sends the first wakeup packet to the relay device. Thefirst wakeup packet carries a device ID of the terminal to be woken up.In addition, the first wakeup packet may further carry a wakeup period,and the wakeup period may be determined by the cloud, and is used toinstruct the relay device to send a wakeup packet to the terminal basedon the wakeup period. A specific value of the wakeup period is notlimited herein. Optionally, the wakeup packet is periodically sent to aproxy module of the relay device based on the wakeup period by using therouter.

Step 8: The relay device constructs a second wakeup packet based on thereceived first wakeup packet.

After receiving the wakeup packet sent by the cloud, the relay deviceparses the wakeup packet to obtain the device ID of the terminal thatneeds to be woken up, and the relay device obtains a networkcommunication related parameter of the terminal based on the device ID.In an optional case, the relay device obtains the network communicationrelated parameter of the terminal from HOSTAPD of the Wi-Fi module,namely, the high-speed communications module. The relay deviceconstructs the second wakeup packet based on a parsing result. Thesecond wakeup packet may include the device ID, the networkcommunication related parameter obtained through parsing, a wakeupfeature code and a wakeup random number that are previously obtainedthrough negotiation, and the like. For example, the networkcommunication related parameter may include a channel parameter of thefirst communication link, an address parameter of the terminal, and thelike. The parameter may be used by the terminal to quickly establish acommunication connection to the relay device by using the firstcommunication link, to restore the normal service mode. The wakeupfeature code is a preset identifier used to identify a wakeup packet.For example, the cloud may instruct, by sending 010101 to the relaydevice, the relay device to wake up the terminal, where 010101 is thewakeup feature code.

Step 9: The relay device sends the second wakeup packet to the terminalthrough the second communication link.

The relay device sends, through the second communication link, thesecond wakeup packet to a wakeup module of the terminal corresponding tothe device ID.

Step 10: After receiving the second wakeup packet, the terminal verifieswhether the wakeup random number carried in the second wakeup packet isconsistent with a wakeup random number that is preset or obtainedthrough negotiation, and if they are consistent, the main control CPU ofthe terminal is powered on, or if they are inconsistent, the terminal isstill in the standby mode. The terminal powers on a part that is of thehigh-speed Wi-Fi module and that is powered off, enables the RF module,and enters the normal service mode. Optionally, the terminal quicklyestablishes a communication connection to the relay device based on thechannel parameter and the address parameter in the second wakeup packet,and resumes service communication through the first communication link.

Step 11: The terminal sends third notification information to the relaydevice through the first communication link, where the thirdnotification information is used to instruct the relay device to stopserving as a proxy for the terminal to send the keep-alive packet to thecloud, so that the terminal enters a business service mode, for example,may perform services such as a login service, a push service, and anon-demand service.

In the embodiment corresponding to FIG. 5, the steps performed by theterminal and the relay device in the standby control method from aperspective of a standby control system are described. The followingdescribes a standby control method from a perspective of modules of aterminal and a relay device. Based on the diagram of the terminalnetworking architecture shown in FIG. 2, FIG. 6 is another interactionflowchart of a standby control method according to an embodiment of thisapplication.

It should be noted that, in this embodiment, a proxy module of a relaydevice may be integrated into a first communications module of the relaydevice or integrated into another module. A specific implementation formof the proxy module of the relay device is not limited herein.

601. A main control module of a terminal sends notification informationto the proxy module of the relay device.

In a business service mode, the terminal may be communicativelyconnected to the cloud by using the relay device and a router. Theterminal transmits data through a first communication link between anetwork communications module of the terminal and a networkcommunications module of the relay device. For example, the firstcommunication link is a high-speed transmission link, and a transmissionrate is greater than 10 megabytes per second.

After the terminal receives a standby instruction, the main controlmodule of the terminal sends the notification information to the proxymodule of the relay device through the first communication link, toinstruct the proxy module of the relay device to enable a cloud standbykeep-alive proxy. The cloud standby keep-alive proxy is used to keep theterminal connected to the cloud.

602. The proxy module of the relay device sends a packet to the cloud.

After receiving the notification information sent by the main controlmodule of the relay device, the proxy module of the relay device enablesthe cloud standby keep-alive proxy.

It should be noted that the proxy module of the relay device is locatedin the relay device. That the proxy module of the relay device sends thepacket to the cloud is actually that the proxy module of the relaydevice sends the packet to the cloud by using the network communicationsmodule of the relay device. Optionally, the packet sent by the proxymodule of the relay device is sent to the cloud by using the router.

In this embodiment, the cloud standby keep-alive proxy may include thefollowing several aspects:

1. The proxy module of the relay device periodically sends a keep-alivepacket to the cloud by using the router, to keep a connection betweenthe terminal and the cloud.

2. The proxy module of the relay device periodically sends a DHCP leaserenewal packet and a gratuitous ARP packet to the router, to keep aconnection between the terminal and the router, where the DHCP leaserenewal packet may be used to renew an IP address lease, and thegratuitous ARP packet is used to prevent an ARP table of the router fromaging.

A period of sending the keep-alive packet by the proxy module of therelay device may be negotiated between the relay device and the cloud byusing a keep-alive packet. A period of sending the DHCP lease renewalpacket and the gratuitous ARP packet may be negotiated between the proxymodule of the relay device and the router, or the DHCP lease renewalpacket and the gratuitous ARP packet may be sent based on a presetperiod. The periods of sending the keep-alive packet, the DHCP leaserenewal packet, and the gratuitous ARP packet by the proxy module of therelay device is not specifically limited herein. For example, the periodof sending the packet to the cloud by the proxy module of the relaydevice may be 30 seconds to 60 seconds. It should be understood that atime interval is set to periodically send the keep-alive packet toreduce power consumption, and setting a proper time interval canproperly reduce system power consumption while keeping a connectionbetween the relay device and the cloud.

603. The main control module of the terminal sends notificationinformation to a wakeup module of the relay device.

The main control module of the terminal sends the standby notificationinformation to the wakeup module of the relay device through the firstcommunication link. The wakeup module of the relay device establishes asecond communication link with a wakeup module of the terminal based onthe standby notification information. The main control module of theterminal may add a heartbeat period and a wakeup random number to thestandby notification information, or the main control module of theterminal and the wakeup module of the relay device negotiate aboutparameters such as a heartbeat period and a wakeup random number byusing a packet.

The heartbeat period is a period of sending a heartbeat packet betweenthe wakeup module of the terminal and the wakeup module of the relaydevice when the terminal is in a standby mode. In an optional case, theperiod of sending the heartbeat packet between the wakeup module of theterminal and the wakeup module of the relay device may be 5 seconds to10 seconds. However, a specific value of the heartbeat period is notspecifically limited in this embodiment of this application.

The wakeup random number is a verification random number used when theterminal is woken up from the standby mode, and performing verificationon the wakeup random number by the terminal can improve security of awakeup process.

It should be noted that an execution sequence of step 601 and step 603is not limited, and step 601 may be performed before step 603, or step603 may be performed before step 601.

604. The wakeup module of the relay device sends notificationinformation to the network communications module of the relay device.

The notification information is used to notify the networkcommunications module of the relay device that the terminal is to enterthe standby mode. After receiving the notification information sent bythe wakeup module of the relay device, the network communications moduleof the relay device enables a device online non-timeout function. Theonline non-timeout function means that the network communications moduleof the relay device sets a related parameter to keep the networkcommunications module of the terminal in an online state. Even ifservice communication has not been performed within a preset time limit,the relay device does not determine that the terminal is offline.

605. The main control module of the terminal sends a message to thenetwork communications module of the terminal.

The main control module of the terminal sends the notificationinformation to the network communications module of the terminal toinstruct the network communications module of the terminal to enter thestandby mode.

606. The network communications module of the terminal enters thestandby mode.

After receiving the notification information sent by the main controlmodule of the terminal, the network communications module of theterminal enters the standby mode.

It should be understood that power is not supplied to most functionmodules of the network communications module in the standby mode, andonly a small amount of power is retained to maintain memory refresh. Forexample, the network communications module of the terminal in thestandby mode disables a radio frequency module and does not transmit orreceive a radio frequency signal any more, and a CPU of the networkcommunications module of the terminal is powered off and does notprocess a communication service any more. Power consumption of thenetwork communications module of the terminal in the standby mode isvery low. In an optional case, a working current of the networkcommunications module of the terminal in this mode is only approximately10 microamperes (uA) to 20 microamperes (uA).

However, the network communications module of the terminal in thestandby mode is not totally powered off, and some modules are stillconsuming power to only maintain memory refresh, so that a normalservice mode can be quickly restored when there is a communicationrequirement.

607. The main control module of the terminal sends notificationinformation to the wakeup module of the terminal.

The main control module of the terminal sends the notificationinformation to the wakeup module of the terminal to notify the wakeupmodule of the terminal that the terminal is to enter the standby mode.The wakeup module of the terminal sets a related parameter, so that thewakeup module can receive and acknowledge a keep-alive packet sent bythe wakeup module of the relay device.

608. The main control module of the terminal is powered off.

The main control module of the terminal is powered off, and the terminalenters the standby mode.

609. The wakeup module of the relay device sends a keep-alive packet tothe wakeup module of the terminal.

The wakeup module of the relay device sends, through the secondcommunication link, the keep-alive packet to the wakeup module of theterminal based on a heartbeat period obtained through negotiation, andthe period of sending the keep-alive packet by the wakeup module of therelay device is not specifically limited. For example, the sendingperiod may be 0.5 seconds to 1 second, to ensure that the terminal canbe woken up in a timely manner when receiving a communicationrequirement of the cloud.

It should be noted that an execution sequence of step 609 and step 604is not specifically limited. Step 604 may be performed before step 609,step 609 may be performed before step 604, or step 604 and step 609 maybe concurrently performed.

610. The wakeup module of the terminal sends acknowledgement informationto the wakeup module of the relay device.

After the wakeup module of the terminal receives the keep-alive packetperiodically sent by the wakeup module of the relay device, the wakeupmodule of the terminal sends the acknowledgement information to thewakeup module of the relay device through the second communication link.After receiving the acknowledgement information sent by the wakeupmodule of the terminal, the wakeup module of the relay device mayconfirm that the terminal is still connected to the relay device. Whenthe terminal is in the standby mode, the terminal performs a heartbeatkeep-alive operation with the wakeup module of the relay device by usingthe wakeup module of the terminal. In an optional case, a workingcurrent of the wakeup module of the terminal is 30 microamperes to 40microamperes, which is significantly lower than a working current ofapproximately 300 microamperes to 400 microamperes when the terminalperforms a heartbeat keep-alive operation by using the networkcommunications module.

611. The cloud sends a wakeup packet to the proxy module of the relaydevice.

When the terminal needs to be woken up, the cloud constructs the wakeuppacket and sends the wakeup packet to the proxy module of the relaydevice. The wakeup packet carries a device ID of the terminal to bewoken up. In addition, the wakeup packet may further carry a wakeupperiod, and the wakeup period may be determined by the cloud, and isused to instruct the relay device to send a wakeup packet to theterminal based on the wakeup period. A specific value of the wakeupperiod is not limited herein. The wakeup packet is periodically sent tothe proxy module of the relay device based on the wakeup period by usingthe router.

612. The proxy module of the relay device sends a wakeup message to thewakeup module of the relay device.

After receiving the wakeup packet sent by the cloud, the proxy module ofthe relay device parses the wakeup packet to obtain the device ID of theterminal that needs to be woken up, and then sends, to the wakeup moduleof the relay device, the wakeup message that carries the device ID.

613. The wakeup module of the relay device obtains a channel parameterof the network communications module of the relay device.

The wakeup module of the relay device receives the wakeup message thatis sent by the network communications module of the relay device andthat carries the device ID. The wakeup module of the relay deviceobtains, from the network communications module of the relay devicebased on the device ID, a parameter such as a channel or an address ofthe network communications module of the relay device. The parameter isa related parameter that may be used by the network communicationsmodule of the terminal to establish a communication connection to thenetwork communications module of the relay device.

614. The wakeup module of the relay device sends a wakeup packet to thewakeup module of the terminal.

The wakeup module of the relay device constructs the wakeup packet, andsends, through the second communication link, the wakeup packet to thewakeup module of the terminal corresponding to the device ID. The wakeuppacket may carry the channel parameter of the network communicationsmodule of the relay device. Optionally, the channel parameter mayinclude information such as a channel or an address. Optionally, thewakeup packet may further carry a wakeup feature code and a wakeuprandom number. The wakeup feature code is a preset identifier used toidentify the wakeup packet. The wakeup module of the terminal verifieswhether the wakeup random number is consistent with a wakeup randomnumber that is preset by the main control module of the terminal ordetermined through negotiation. If they are consistent, the wakeupmodule of the terminal wakes up the terminal, or if they areinconsistent, the wakeup module of the terminal does not wake up theterminal.

615. The wakeup module of the terminal wakes up the main control module.

The wakeup module of the terminal receives the wakeup packet, and wakesup the main control module of the terminal based on the wakeup packet,and the main control module of the terminal is powered on.

616. The wakeup module of the terminal wakes up the networkcommunications module of the terminal.

After receiving the wakeup packet, the wakeup module of the terminal maywake up the network communications module of the terminal based on thewakeup packet. A part that is of the network communications module andthat is powered off is powered on again, and the radio frequency moduleis enabled to enter the normal service mode. Optionally, the wakeupmodule of the terminal sends notification information to the networkcommunications module of the terminal. The notification information maycarry the channel parameter of the network communications module of therelay device. The network communications module may quickly resumeservice communication through the first communication link based on thechannel parameter.

617. The main control module of the terminal sends notificationinformation to the network communications module of the relay device.

The main control module of the terminal sends the notificationinformation to the network communications module of the relay devicethrough the first communication link, to instruct the networkcommunications module of the relay device to terminate a terminalkeep-alive proxy, and the terminal enters a business service mode, andmay perform services such as a login service, a push service, and anon-demand service.

According to the standby control method provided in this embodiment ofthis application, a second communications module of the terminal and therelay device are added. In the standby mode, a first communicationsmodule of the terminal enters an ultra-low power consumption standbymode, and the terminal keeps a heartbeat connection to the relay deviceby using the second communications module of the terminal. Because powerconsumption of the second communications module of the terminal is lowerthan that of the first communications module of the terminal, powerconsumption of the terminal in the standby mode is reduced.

The standby control method is described in the foregoing embodiment. Thefollowing describes a terminal that implements the standby controlmethod. FIG. 7 is a schematic diagram of a standby control terminalaccording to an embodiment of this application.

The terminal includes a main control module 701 of the terminal, a firstcommunications module 702 of the terminal, and a second communicationsmodule 703 of the terminal.

The main control module 701 of the terminal is configured to control theterminal to enter a standby mode. For details, refer to descriptions ofstep 601, step 603, step 605 to step 608, and step 617 in the methodembodiment. Details are not described herein again.

The first communications module 702 of the terminal is configured totransmit data in a service communication mode. When the terminal entersthe standby mode, the first communications module 702 of the terminalstops working. For details, refer to descriptions of step 606 and step616 in the method embodiment. Details are not described herein again.

The second communications module 703 of the terminal is configured toperform a heartbeat keep-alive function when the terminal is in thestandby mode and wake up the terminal from the standby mode. Fordetails, refer to descriptions of step 607, step 610, step 615, and step616 in the method embodiment. Details are not described herein again. Inthis embodiment of this application, when being in the standby mode, theterminal performs a heartbeat keep-alive operation with a relay deviceby using the second communications module 703 of the terminal, the firstcommunications module of the terminal disables a radio frequency module,and the main control module 701 of the terminal is powered off. Becausepower consumption of the second communications module 703 of theterminal in the standby mode is lower than that of the firstcommunications module of the terminal, power consumption of the terminalin the standby mode is reduced.

The foregoing describes the terminal that implements the standby controlmethod. The following describes a relay device that implements thestandby control method. FIG. 8 is a schematic diagram of an embodimentof a relay device according to the embodiments of this application.

The relay device includes a first communications module 801 of the relaydevice, a second communications module 802 of the relay device, and aproxy module 803 of the relay device.

The first communications module 801 of the relay device is configuredto: when a terminal is in a business service mode, provide a connectionfor the terminal and the cloud for data transmission. For details, referto descriptions of step 604, step 605 to step 608, and step 617 in themethod embodiment. Details are not described herein again.

The second communications module 802 of the relay device is configuredto perform a heartbeat keep-alive function in cooperation with a secondcommunications module of the terminal when the terminal is in a standbymode and wake up the terminal from the standby mode. For details, referto descriptions of step 603, step 604, step 609, step 610, and step 612to step 614 in the method embodiment. Details are not described hereinagain.

The proxy module 803 of the relay device is configured to: after theterminal enters the standby mode, serve as a proxy for the terminal tokeep a connection to the cloud and receive a cloud wakeup message. Fordetails, refer to descriptions of step 601, step 602, step 611, and step612 in the method embodiment. Details are not described herein again.

It should be noted that, in this embodiment, the proxy module 803 of therelay device may be integrated into the first communications module 801of the relay device for implementation, and details are not describedherein.

In this embodiment of this application, when the terminal enters thestandby mode, the relay device may keep a heartbeat connection to theterminal by using the second communications module 802 of the relaydevice, or may enable a cloud standby keep-alive proxy by using theproxy module 803 of the relay device, so that the terminal still keeps aconnection to the relay device, a router, and the cloud when theterminal is in the standby mode, and can quickly resume servicecommunication when being woken up. Communication with a secondcommunications module of the terminal by using the second communicationsmodule 802 of the relay device can further reduce power consumption of astandby module of the terminal.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, refer to acorresponding process in the foregoing method embodiments, and detailsare not described herein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely an example. For example, the unit division ismerely logical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented by using some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected based on actualrequirements to achieve the objectives of the solutions of theembodiments.

In addition, functional units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software functional unit.

An embodiment of this application further provides a computer-readablestorage medium. The computer-readable storage medium stores aninstruction; and when the instruction runs on a computer, the computerperforms one or more steps in any one of the foregoing methods. Wheneach component module of the terminal or the relay device is implementedin a form of a software functional unit and sold or used as anindependent product, the component modules may be stored in thecomputer-readable storage medium.

Based on such an understanding, the technical solutions of thisapplication essentially, or the part contributing to the prior art, orall or some of the technical solutions may be implemented in a form of asoftware product. The software product is stored in a storage medium andincludes several instructions for instructing a computer device (whichmay be a personal computer, a server, a network device, or the like) toperform all or some of the steps of the methods described in theembodiments of this application. The foregoing storage medium includes:any medium that can store program code, such as a USB flash drive, aremovable hard disk, a read-only memory (ROM), a random access memory(RAM), a magnetic disk, or an optical disc.

In conclusion, the foregoing embodiments are merely intended fordescribing the technical solutions of this application, but not forlimiting this application. Although this application is described indetail with reference to the foregoing embodiments, persons of ordinaryskill in the art should understand that they may still makemodifications to the technical solutions described in the foregoingembodiments or make equivalent replacements to some technical featuresthereof, without departing from the scope of the technical solutions ofthe embodiments of this application.

What is claimed is:
 1. A standby control method, comprising: after astandby instruction is received, sending first notification informationto a relay device through a first communication link, wherein the firstnotification information is used to instruct the relay device to serveas a proxy for a terminal to send a first keep-alive packet to a cloudserver to inform the cloud server that the terminal is online; disablingthe first communication link and a main control central processing unit(CPU); receiving a second keep-alive packet sent by the relay devicethrough a second communication link, wherein a communication rate of thesecond communication link is lower than a communication rate of thefirst communication link; and returning acknowledgement information ofthe second keep-alive packet, through the second communication link, toinform the relay device that the terminal is online.
 2. The standbycontrol method according to claim 1, wherein after the disabling themain control CPU, the method further comprises: receiving a wakeuppacket sent by the relay device through the second communication link;instructing, based on the wakeup packet, the main control CPU to bepowered on; and enabling the first communication link based on thewakeup packet.
 3. The method according to claim 1, wherein the disablingthe first communication link comprises disabling an RF module used forhigh-speed data transmission.
 4. The method according to claim 2,wherein the wakeup packet comprises a channel parameter of the firstcommunication link; and the first communication link is enabled based onthe channel parameter to perform service communication with the relaydevice through the first communication link.
 5. The method according toclaim 1, wherein a communication resource occupied by theacknowledgement information of the second keep-alive packet is smallerthan a communication resource occupied by the second keep-alive packet.6. A standby control method, comprising: receiving first notificationinformation sent by a terminal through a first communication link; underan instruction of the first notification information, serving as a proxyfor the terminal to send a first keep-alive packet to a cloud server toinform the cloud server that the terminal is online; sending a secondkeep-alive packet to the terminal through a second communication link;receiving, through the second communication link, acknowledgementinformation that is of the second keep-alive packet and that is returnedby the terminal, wherein a communication rate of the secondcommunication link is lower than a communication rate of the firstcommunication link; and confirming, based on the acknowledgementinformation, that the terminal is online.
 7. The method according toclaim 6, wherein the method further comprises: sending a wakeup packetto the terminal through the second communication link, wherein thewakeup packet is used for the terminal enabling a main control centralprocessing unit (CPU) and the first communication link based on thewakeup packet.
 8. The method according to claim 7, wherein the enablingthe first communication link comprises enabling an RF module used forhigh-speed data transmission.
 9. The method according to claim 6,wherein before the sending the second keep-alive packet to the terminalthrough the second communication link, the method further comprises:receiving second notification information sent by the terminal throughthe first communication link; and setting, based on the secondnotification information, the terminal to be in a connected state on thefirst communication link.
 10. The method according to claim 6, wherein acommunication resource occupied by the acknowledgement information ofthe second keep-alive packet is smaller than a communication resourceoccupied by the second keep-alive packet.
 11. A terminal, comprising amain processor and a subordinate processor, wherein the main processoris configured to read a software instruction in a memory, and executethe software instruction to implement the following operations: after astandby instruction is received, send first notification information toa relay device through a first communication link, wherein the firstnotification information is used to instruct the relay device to serveas a proxy for the terminal to send a first keep-alive packet to a cloudserver to inform the cloud server that the terminal is online; anddisable the first communication link and a main control centralprocessing unit (CPU); and the subordinate processor is configured toread a software instruction in a memory, and execute the softwareinstruction to implement the following operations: receive a secondkeep-alive packet sent by the relay device through a secondcommunication link, wherein a communication rate of the secondcommunication link is lower than a communication rate of the firstcommunication link; and return acknowledgement information of the secondkeep-alive packet to inform the relay device that the terminal isonline.
 12. The terminal according to claim 11, wherein the subordinateprocessor is further configured to: receive a wakeup packet sent by therelay device through the second communication link; instruct, based onthe wakeup packet, the main processor to enable the main control CPU;and instruct, based on the wakeup packet, the main processor to enablethe first communication link.
 13. The terminal according to claim 11,wherein the main processor is further configured to: disable an RFmodule used for high-speed data transmission.
 14. The terminal accordingto claim 12, wherein the wakeup packet comprises a channel parameter ofthe first communication link; and the main processor is furtherconfigured to enable the first communication link based on the channelparameter to perform service communication with the relay device throughthe first communication link.
 15. The terminal according to claim 12,wherein: the main processor is further configured to negotiate with therelay device about a heartbeat period by using the first communicationlink; and the subordinate processor is further configured to receive thesecond keep-alive packet sent by the relay device through the secondcommunication link based on the heartbeat period.
 16. A relay device,comprising a main processor and a subordinate processor, wherein themain processor is configured to read a software instruction in a memory,and execute the software instruction to implement the followingoperations: receive first notification information sent by a terminalthrough a first communication link; and under an instruction of thefirst notification information, serve as a proxy for the terminal tosend a first keep-alive packet to a cloud server to inform the cloudserver that the terminal is online; and the subordinate processor isconfigured to read a software instruction in a memory, and execute thesoftware instruction to implement the following operations: send asecond keep-alive packet to the terminal through a second communicationlink; and receive, through the second communication link,acknowledgement information that is of the second keep-alive packet andthat is returned by the terminal, wherein a communication rate of thesecond communication link is lower than a communication rate of thefirst communication link; and confirm, based on the acknowledgementinformation, that the terminal is online.
 17. The relay device accordingto claim 16, wherein the subordinate processor is further configured to:send a wakeup packet to the terminal through the second communicationlink, wherein the wakeup packet is used for the terminal enabling a maincontrol CPU and the first communication link based on the wakeup packet.18. The relay device according to claim 17, wherein enabling the firstcommunication link comprises enabling an RF module used for high-speeddata transmission.
 19. The relay device according to claim 18, whereinthe main processor is further configured to: receive second notificationinformation sent by the terminal through the first communication link,to learn that the terminal is to disable the RF module; and set, basedon the second notification information, the terminal to be in an onlinestate on the first communication link.
 20. The relay device according toclaim 16, wherein the main processor is further configured to: stopsending the first keep-alive packet to the cloud server to disconnectthe terminal from the cloud server, when the subordinate processor hasnot received, within a preset time limit, the acknowledgementinformation that is of the second keep-alive packet and that is returnedby the terminal.